package com.xxl.job.executor.xxljob.autoregister.enums;


/**
 * @author lukaidong
 * @date 2024/03/01
 * @description xxl-job执行器调度策略
 */
public enum XxlExecutorRouteStrategyEnum {

    FIRST("FIRST", "第一个"),
    LAST("LAST", "最后一个"),
    ROUND("ROUND", "轮询"),
    RANDOM("RANDOM", "随机"),
    CONSISTENT_HASH("CONSISTENT_HASH", "一致性哈希路由"),// 希望不重复执行，用一致性hash路由 + 丢弃后续调度的阻塞策略
    LEAST_FREQUENTLY_USED("LEAST_FREQUENTLY_USED", "最不经常使用"),
    LEAST_RECENTLY_USED("LEAST_RECENTLY_USED", "最久未使用"),
    FAILOVER("FAILOVER", "故障转移"),
    BUSYOVER("BUSYOVER", "忙碌转移"),
    SHARDING_BROADCAST("SHARDING_BROADCAST", "分片广播");// 数据分片用分片广播 + 丢弃后续调度的阻塞策略

    private final String code;
    private final String desc;

    XxlExecutorRouteStrategyEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
